package com.scedu.springcloud.springcloud.service;

import com.scedu.springcloud.springcloud.entity.CommonResult;
import com.scedu.springcloud.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//此处编写需要通信的微服务名称
@FeignClient(name = "CLOUD-PAYMENT-SERVICE",fallback = OrderFeignFallbackService.class)
@Component
public interface OrderFeignService {
    //当前GetMapping是获取另一个微服务的具体控制器
    @GetMapping(value = "payment/get/{id}")

    CommonResult getPaymentById(@PathVariable("id") Long id);

    @GetMapping(value = "payment/create")
    CommonResult create(Payment payment);

    @GetMapping(value = "payment/timeout")
    String timeout();
}
